From: Florian Müllner Date: Sat, 17 Jun 2017 16:31:34 +0000 (+0200) Subject: shellDBus: Avoid access to undefined properties X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~259 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ccaae5d3cc0617595ee96c3a42c8d4bc2327074a;p=gnome-shell.git shellDBus: Avoid access to undefined properties Don't rely on an implicit undefined value of unset parameters to shut up some warnings. https://bugzilla.gnome.org/show_bug.cgi?id=781471 --- diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js index 9259f8488..8c9ff0c2d 100644 --- a/js/ui/shellDBus.js +++ b/js/ui/shellDBus.js @@ -145,15 +145,15 @@ const GnomeShell = new Lang.Class({ for (let param in params) params[param] = params[param].deep_unpack(); - let monitorIndex = -1; - if (params['monitor'] >= 0) - monitorIndex = params['monitor']; + let monitorIndex = params['monitor'] || -1; + let label = params['label'] || undefined; + let level = params['level'] || undefined; let icon = null; if (params['icon']) icon = Gio.Icon.new_for_string(params['icon']); - Main.osdWindowManager.show(monitorIndex, icon, params['label'], params['level']); + Main.osdWindowManager.show(monitorIndex, icon, label, level); }, FocusApp: function(id) {